var status = 0;
var typede = 0;

function start() {
    status = -1;
    action(1, 0, 0)
}

function action(h, f, e) {
    if (h == -1) {
        cm.dispose()
    } else {
        if (h == 0) {
            cm.dispose();
            return
        }
        if (h == 1) {
            status++
        }
        if (cm.getVipLevel() == 0) {
            var g = "" + (1440 - cm.getVipExp()) + "";
            var d = "1440";
            var b = "" + cm.getVipLevel() + 1 + ""
        }
        if (cm.getVipLevel() == 1) {
            var g = "" + (1440 - cm.getVipExp()) + "";
            var d = "1440";
            var b = "" + (cm.getVipLevel() + 1) + ""
        }
        if (cm.getVipLevel() == 2) {
            var g = "" + (4320 - cm.getVipExp()) + "";
            var d = "4320";
            var b = "" + (cm.getVipLevel() + 1) + ""
        }
        if (cm.getVipLevel() == 3) {
            var g = "" + (10080 - cm.getVipExp()) + "";
            var d = "10080";
            var b = "" + (cm.getVipLevel() + 1) + ""
        }
        if (cm.getVipLevel() == 4) {
            var g = "" + (21600 - cm.getVipExp()) + "";
            var d = "21600";
            var b = "" + (cm.getVipLevel() + 1) + ""
        }
        if (cm.getVipLevel() == 5) {
            var g = "" + (36000 - cm.getVipExp()) + "";
            var d = "36000";
            var b = "" + (cm.getVipLevel() + 1) + ""
        }
        if (cm.getVipLevel() == 6) {
            var g = "" + (57600 - cm.getVipExp()) + "";
            var d = "57600";
            var b = "" + (cm.getVipLevel() + 1) + ""
        }
        if (cm.getVipLevel() == 7) {
            var g = "最高等级";
            var d = "最高等级";
            var b = "最高等级"
        }
        if (status == 0) {
            var c = cm.getVipExp();
            var a = "";
            a = "#fMob/1210102.img/move/0##fMob/1210102.img/move/0##bPPMS - 143#fMob/1210102.img/move/0##fMob/1210102.img/move/0#\r\n#k";
            a += "您的超级VIP信息如下：\r\n";
            a += "VIP等级: #r" + cm.getVipLevel() + "               #kVIP名称: #b" + cm.getPlayer().getVipName() + "#k\r\n";
            a += "VIP到期时间: #r" + cm.getVipTimeShow() + "#k\r\n";
            a += "#kVIP经验: #r" + cm.getVipExp() + "/" + d + "#k           \r\n升级VIP：#r" + b + "     #k还需经验：#r" + g + "#b#n\r\n";
            a += "                    #L1##b查看规则#l \r\n\r\n";
            a += "           #L2##b开通VIP#l  #fMob/0130101.img/move/0##L3##rVIP续费#k#l\r\n";
            a += "    #L4##rVIP等级送礼#l               #L5##rVIP每日福利#l\r\n";
            cm.askMenu(a)
        } else {
            if (e == 1) {
                var a = "";
                a += "#fMob/1210102.img/move/0##fMob/1210102.img/move/0##bPPMS - 143#fMob/1210102.img/move/0##fMob/1210102.img/move/0#\r\n#kVIP规则如下:\r\nVIP等级分7个阶段,每个阶段的福利都不同(等级越高福利越好)。\r\n开通VIP后游戏在线每5分钟VIP经验增加1,达到要求VIP等级自动升级。\r\n#r注意:#kVIP过期后每天会自动扣除经验点数200,VIP等级也会降低。\r\nVIP福利详解:\r\nVIP1、基础爆率x1.3 上线炫酷广播 专属每日福利\r\n";
                a += "VIP2、基础爆率x1.4 上线炫酷广播 专属每日福利\r\n";
                a += "VIP3、基础爆率x1.5 上线炫酷广播 专属每日福利\r\n";
                a += "VIP4、基础爆率x1.6 上线炫酷广播 专属每日福利\r\n";
                a += "VIP5、基础爆率x1.7 上线炫酷广播 专属每日福利\r\n";
                a += "VIP6、基础爆率x1.8 上线炫酷广播 专属每日福利\r\n";
                a += "VIP7、基础爆率x2.0 上线炫酷广播 专属每日福利\r\n";
                a += "购买VIP时间为30天,续费时间为30天。续费时间可以和基础时间叠加,完美实现提前续费。\r\n";
                cm.sendOk(a);
                cm.dispose()
            } else {
                if (e == 2) {
                    if (cm.getVipLevel() > 0) {
                        cm.sendOk("您已经开通了超级VIP,无法重复开通。\r\n\r\n如果您的超级VIP过期请使用VIP续费进行再次开通。")
                    } else {
                        if (cm.getJQ() >= 500) {
                            cm.addJQ(-500);
                            cm.setVip(30);
                            cm.sendOk("超级VIP开通成功。\r\n\r\n您的VIP到期时间: #r" + cm.getVipTimeShow() + "#k");
                            cm.worldSpouseMessage(32, "玩家 " + cm.getPlayer().getName() + " 开通了超级VIP，有了他(她)的赞助追忆MS会为大家带来更加完美的游戏体验。")
                        } else {
                            cm.sendOk("开通失败,开通超级VIP需要#b500金卷#k。\r\n\r\n账户金卷: #r" + cm.getJQ() + "")
                        }
                    }
                    cm.dispose()
                } else {
                    if (e == 3) {
                        if (cm.getVipLevel() == 0) {
                            cm.sendOk("您没有开通VIP,请先开通VIP在续费。\r\n\r\n如果您VIP到期没时间续费,可以提前续费VIP。VIP时间会叠加！")
                        } else {
                            if (cm.getJQ() >= 500) {
                                cm.addJQ(-500);
                                cm.addVip(30);
                                cm.sendOk("续费VIP成功,您的VIP时间增加了30天。\r\n\r\nVIP到期时间: #r" + cm.getVipTimeShow() + "#k");
                                cm.worldSpouseMessage(32, "玩家 " + cm.getPlayer().getName() + " 续费了超级VIP，有了他(她)的赞助追忆MS会为大家带来更加完美的游戏体验。")
                            } else {
                                cm.sendOk("续费失败,续费超级VIP需要#b500金卷#k。\r\n\r\n账户金卷: #r" + cm.getJQ() + "")
                            }
                        }
                        cm.dispose()
                    } else {
                        if (e == 4) {
                            cm.dispose();
                            cm.openNpc(9010002)
                        } else {
                            if (e == 5) {
                                cm.dispose();
                                cm.openNpc(9010002, 1)
                            }
                        }
                    }
                }
            }
        }
    }
};